]> dgit.raspbian.org Git - gnome-shell.git/commit
cleanup: Don't assume hasOwnProperty() method on objects
authorFlorian Müllner <fmuellner@gnome.org>
Sat, 29 Jun 2019 23:05:27 +0000 (01:05 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Thu, 12 Sep 2019 21:18:27 +0000 (23:18 +0200)
commit0ee7f02f8ec15280fbb699bb22cac481dee25e96
tree27719a3603f74f7a355cb7ac8f88ec3b6649f4a9
parent451f4e363604c5106ab263e210c52fc94905a949
cleanup: Don't assume hasOwnProperty() method on objects

Since ES5, it is possible to create objects with no prototype at all:

    let foo = Object.create(null);

Those object won't have any builtin properties like hasOwnProperty(),
which is why eslint added a corresponding rule to its default rule set.

While this isn't an issue that affects our code, there's no harm in fol-
lowing the recommendation and call the method through Object.prototype.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/716
js/ui/layout.js
js/ui/sessionMode.js